<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Address Page</title>
</head>
<body>
	<%
		//get resident info from resident page and set to session
		String countryOfResident = request
				.getParameter("CountryOfResident");
		session.setAttribute("CountryOfResident", countryOfResident);

		boolean flag = false;
		if (countryOfResident.equals("United States"))
			flag = true;
	%>
	<p>
		Hello, 
		<%=session.getAttribute("FirstName")%>
		<%=session.getAttribute("MiddleI")%>
		<%=session.getAttribute("LastName")%>
	<p>
		Your country of citizenship is:
		<%=session.getAttribute("CountryOfCitizenship")%>
	<p>
		Your country of resident is:
		<%=countryOfResident%>
	<p>
		Input your address:

		<%
		if (flag) {
	%>
	
	
	<form method="get" action="degreeLocation.jsp">
		<table border="1">
			<tr>
				<td>Street Address:</td>
				<td><input type="text" size="30" maxlength="30"
					name="StreetAddress" /></td>
			</tr>
			<tr>
				<td>City:</td>
				<td><input type="text" size="20" maxlength="20" name="City" /></td>
			</tr>

			<tr>
				<td>State:</td>
				<td><input type="text" size="20" maxlength="20"
					name="AddressState" /></td>
			</tr>

			<tr>
				<td>Zip Code:</td>
				<td><input type="text" size="5" maxlength="5" name="ZipCode" />
			</tr>
			<tr>
				<td>Area Code:</td>
				<td><input type="text" size="4" maxlength="4" name="AreaCode" /></td>
			</tr>
			<tr>
				<td colspan="2" align="right"><input type="submit"
					value="submit" size="10" /> <input type="hidden" name="action"
					value="addr"></td>

			</tr>
		</table>
	</form>
	<%
		} else {
	%>

	<form method="get" action="residency.jsp">
		<table border="1">
			<tr>
				<td>Street Address:</td>
				<td><input type="text" size="30" maxlength="30"
					name="StreetAddress" /></td>
			</tr>
			<tr>
				<td>City:</td>
				<td><input type="text" size="20" maxlength="20" name="City" /></td>
			</tr>

			<tr>
				<td>Country Telephone Code:</td>
				<td><input type="text" size="5" maxlength="5" name="AddressState" /></td>
			</tr>

			<tr>
				<td>Zip Code:</td>
				<td><input type="text" size="5" maxlength="5" name="ZipCode" />
			</tr>
			<tr>
				<td>Area Code:</td>
				<td><input type="text" size="4" maxlength="4" name="AreaCode" /></td>
			</tr>
			<tr>
				<td colspan="2" align="right"><input type="submit"
					value="submit" size="10" /></td>
			</tr>
		</table>
	</form>
	<%
		}
	%>
</body>
</html>